#define _CRT_SECURE_NO_WARNINGS 1
#include"RBTree.h"

void test1()
{
	//int a[] = { 16, 3, 7, 11, 9, 26, 18, 14, 15 };
	int a[] = { 4, 2,6 , 1, 5, 15, 7, 16, 14,66,77,88,99 };
	RBTree<int, int> t;
	for (auto e : a)
	{
		t.Insert(make_pair(e, e));
		cout << "Insert:" << e << "->" << t.IsBalanceTree() << endl;
	}
	return ;
}

void test2()
{
	const int N = 1000;
	vector<int> v;
	v.reserve(N);

	srand(time(nullptr));

	for (int i = 0;i < N; i++)
	{
		v.push_back(i);
	}

	RBTree<int, int> t;
	for (auto& e : v)
	{
		t.Insert(make_pair(e, e));
		cout << "Insert:" << e << "->" << t.IsBalanceTree() << endl;
	}
}
int main()
{
	test2();
	return 0;
}